<?php
// +----------------------------------------------------------------------
// | Name: 正义CMS管理系统 [ 为了快速搭建软件应用而生的，希望能够帮助到大家提高开发效率。 ]
// +----------------------------------------------------------------------
// | Copyright: (c) 2024~2024 https://www.hczycm.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed: 这是一个自由软件，允许对程序代码进行修改，但希望您留下原有的注释。
// +----------------------------------------------------------------------
// | Author: 韩城正义传媒  <kefu@hczycm.com>
// +----------------------------------------------------------------------
// | Version: V1
// +----------------------------------------------------------------------

/**
 * @Name
 * @Description
 * @Auther 韩城正义传媒
 * @Date 2024/6/2 06:45
 */

namespace Modules\Admin\Http\Controllers\v1;

use Modules\Admin\Http\Requests\PwdRequest;
use Modules\Admin\Services\admin\UpdatePasswordService;
use Modules\Admin\Services\auth\MenuService;
use Modules\Admin\Services\auth\TokenService;

class IndexController extends BaseApiController
{
    public function refreshToken()
    {
        return (new TokenService())->refreshToken();
    }

    public function info()
    {
        return (new TokenService())->info();
    }

    public function logout()
    {
        return (new TokenService())->logout();
    }

    public function updatePassword(PwdRequest $request)
    {
        return (new UpdatePasswordService())->updatePassword($request->only(['y_password','password']));
    }

    public function getModel()
    {
        return (new MenuService())->getModel();
    }
}
